package com.aiyan.edu.api.cms;

import com.aiyan.edu.framework.domain.cms.CmsPage;
import com.aiyan.edu.framework.domain.cms.request.QueryPageRequest;
import com.aiyan.edu.framework.domain.cms.response.CmsPageResult;
import com.aiyan.edu.framework.domain.cms.response.CmsPostPageResult;
import com.aiyan.edu.framework.model.response.QueryResponseResult;
import com.aiyan.edu.framework.model.response.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

import java.io.UnsupportedEncodingException;

/**
 * @author: zqzhou
 * @create: 2019/10/17 10:17
 **/
@Api(value = "cms页面管理接口", description = "cms页面管理接口，提供页面的增删改查")
public interface CmsPageControllerApi {

    /**
     * 按条件分页查询页面数据
     *
     * @param queryPageRequest 查询条件
     * @param page             页码
     * @param size             每页数据条数
     * @return
     */
    @ApiOperation("分页查询页面列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page", value = "页码", required = true, paramType = "path", dataType = "int"),
            @ApiImplicitParam(name = "size", value = "每页数据条数", required = true, paramType = "path", dataType = "int")
    })
    public QueryResponseResult findList(int page, int size, QueryPageRequest queryPageRequest);

    /**
     * 添加页面
     *
     * @param cmsPage 页面数据
     * @return 新增结果
     */
    @ApiOperation("添加页面")
    public CmsPageResult add(CmsPage cmsPage);

    /**
     * 保存页面
     *
     * @param cmsPage 页面数据
     * @return 新增结果
     */
    @ApiOperation("保存页面")
    public CmsPageResult save(CmsPage cmsPage);

    /**
     * 查询页面
     *
     * @param id 页面id
     * @return 页面数据
     */
    @ApiOperation("通过ID查询页面")
    @ApiImplicitParam(name = "id", value = "页面id", required = true, paramType = "path", dataType = "String")
    public CmsPageResult findById(String id);

    /**
     * 修改页面
     *
     * @param id
     * @param cmsPage
     * @return
     */
    @ApiOperation("修改页面")
    @ApiImplicitParam(name = "id", value = "页面id", required = true, paramType = "path", dataType = "String")
    public CmsPageResult update(String id, CmsPage cmsPage);

    /**
     * 删除页面
     *
     * @param id
     * @return
     */
    @ApiOperation("删除页面")
    @ApiImplicitParam(name = "id", value = "页面id", required = true, paramType = "path", dataType = "String")
    public ResponseResult delete(String id);

    /**
     * 页面发布
     *
     * @param id
     * @return
     */
    @ApiOperation("发布页面")
    @ApiImplicitParam(name = "id", value = "页面id", required = true, paramType = "path", dataType = "String")
    public CmsPostPageResult post(String id);

    /**
     * 一键发布页面
     *
     * @param cmsPage
     * @return
     */
    @ApiOperation("一键发布页面")
    public CmsPostPageResult postQuick(CmsPage cmsPage);
}
